home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: Scope
/
Scope Disk #048 (199x)(Scope PD)(US)[WB].zip
/
Scope Disk #048 (199x)(Scope PD)(US)[WB].adf
/
Auto13
/
readme.1st
< prev
next >
Wrap
Text File
|
1989-01-11
|
15KB
|
287 lines
Read through this original text for auto-addmem then follow the directions
in autoaddmem13.
AUTO-ADDMEM PATCH FOR KICKSTART
===============================
Many Amiga owners have purchased or made expansion RAM boards for our
machines. While most of the current commercially available RAM expansions
have auto-config capabilities. Unfortunately, a lot of the earlier RAM
expansions and "home brew" kits do not offer the luxury of auto-config.
The ADDMEM command supplied for non auto-config expansions, while functional,
requires the inconvenience of placing it in the startup-sequence of all
disk that could use the RAM. This patch is for those of us without
auto-config. The patch is added to the Kickstart disk, performing the
ADDMEM function whenever a "cold boot" is performed. The Kickstart
execution of ADDMEM should eliminate the problems some RAM experience with
ADDMEM and recoverable RAM disks (RRD, VD0:, Survivor, etc.).
The patch instructions were originally posted by Dan Babcock (PLink: OPS239)
in a text file. I was able to complete the patch in about an hour (including
the drawing). This "read me" contains parts of his original with
modifications for clarity. The patch as originally posted required
DiskZap (a disk sector editor), DPaint (a drawing program), a 68000
assembler (or knowledge of assembly), and SumKick (a checksum generator for
Kickstart). These files were not included in the instructions download.
DiskZap and SumKick are included in this archive. I included the actual
hexadecimal object code required for the patch, thus eliminating the
assembler part and Dpaint (unless you want your own artwork).
PLEASE read the docs for DiskZap and SumKick carefully before attempting the
patch. Also, work with a COPY of your Kickstart (as if that had to be said).
___________________ Original Text by Dan Babcock ______________________
| |
V V
Patching kickstart:
The first question to answer is "Where do I put my patch?". One good spot
is the place where the upside down hand is drawn, which is where I've
put the "ADDMEM" patch. The second question is "How do I send the bootup
routines to my code?". I have chosen to modify a pointer in the device
driver-type structure at the beginning of the "strap" routine. How did
I find out about "strap"? You type "mods" in the 1.0 version of WACK and
it gives you a list of devices,resouces,and that kind of stuff. "strap"
is the code that boots a "workbench" type of disk and displays the
upside down hand. The address that WACK V1.0 gives you is the address of
a "rom tag". A "rom tag" is a fancy name that means a bunch of data. The
format of the data is found in the documentation of the skeleton device
driver in the ROM KERNAL MANUAL VOLUME 2, near the very back. The pointer
we are going to change is called "RT_INIT". It's a pointer to the "strap"
routine. The pointer, located at address $FE889A normally contains
$FE88D6. We'll change it to $FE8CFE, the part of kickstart that displays
the upside down hand. I'll take about the display routine in detail
later. Now we need code to put at $FE8CF8. Fortunately, V1.2 of kickstart
added a very convenient command to add memory. Here's a routine to do it:
JMP $FE8D6A ;SKIP OVER THIS PATCH (SO IT WILL ONLY BE RUN ONCE)
MOVEM.L D0/D1/D2/A0/A1/A6,-(A7)
MOVE.L 4,A6
MOVE.L #NUMBER OF BYTES TO ADD,D0
MOVE.L #$10005,D1 ; ADD "FAST" MEMORY
MOVEQ #0,D2
MOVE.L #$ADDRESS OF EXTRA MEMORY,A0
SUB.L A1,A1
JSR -618(A6)
MOVEM.L (A7)+,D0/D1/D2/A0/A1/A6
JMP $FE88D6 ;GO TO THE NORMAL "STRAP" PROGRAM. OUR PART IS FINISHED.
Simple eh? IMPORTANT NOTE!!!:
If you have done the AMAZING COMPUTING 512K upgrade and did the 2 chip
fix which disables the RAM so it won't be allocated as chip RAM....
you must add a few lines of code to enable the RAM BEFORE you do the
add!!!! A few lines like this:
BCLR #7,$BFD100 ;TURN ON MOTOR
BSET #3,$BFD100
BCLR #3,$BFD100
BSET #7,$BFD100 ;TURN OFF MOTOR
BSET #3,$BFD100
BCLR #3,$BFD100
The changes can be made fairly easily using DISKZAP. Here are the sector
numbers: (I think the byte numbers are right, but double check me!
That goes for all the numbers I give in this file.)
The pointer: SECTOR $145, BYTE $9A
The display hand patch code: SECTOR $147, BYTE $F8
***********************************************************************
******** NOW FOR THE REALLY FUN PART!!!!!
******** AMAZE YOUR FRIENDS WITH A CUSTOM BIT MAP WHERE THE
******** "INSERT WORKBENCH" SCREEN USED TO BE (BEFORE YOU MODIFIED
******** IT USING THE INFORMATION BELOW)
***********************************************************************
THE DISPLAY HAND ROUTINE IN DETAIL:
This is the routine that is called when you boot (or reset) and have a
disk in the drive that is not a bootable disk (or no disk at all).
The infamous "upside down hand" routine.
It uses a combination of line drawing and straight bit maps to optimize
memory use. The hand and the disk are made by drawing lines and doing area
fills. The text - "Work Bench", "V1.2" - is made using straight bit maps.
Because the routine is table driven, modifying the display is easy.
All you have to know is the format of the tables. Since the AUTO-ADDMEM
fix discribed above uses the line draw portion for space, I will talk
about the bit map part. First, load up DPAINT and create a picture, any
picture, as long as it isn't too big. USE THE ONE COLOR MODE!
Before you get a feel for how much
room you have, keep it very small. Save it as a brush, so it won't be saved
in a compressed format. Now you need to know the format of the bit map in
"strap":
The first byte determines whether or not this is the last display
sequence. If the high bit is set, the routine exits. The second byte
is a bit plane mask, determining which bit planes may be written to.
If this is $FF, then all bit planes are writable. Which ones are actually
written to depend on which color register was defined as the "pen". In
this case, color register 3 was chosen. This means that, assuming all bit
planes are enabled, bit planes 1 and 2 will be written in with ones,
selecting color register 3, just like we asked. If however, we set the
mask to 2, only bit plane 2 will be written in, and so we will actually
be displaying color register 2. If we put a 1 in, color 1 is displayed, and
if 0 is there, nothing is displayed (not real useful). Nothing mysterious
there. The third and forth bytes are the dimensions of the thing we are
displaying, the third byte being the width and the forth the height.
The fifth and sixth bytes are the coordinates to place the picture, first
X, then Y. After that is the actual data.
"Where do I get the 'actual data'?"
where "FILENAME" is the name of your picture. You should see a bunch of
hexadecimal numbers and ASCII text to the right. Notice "ILBMHMHD".
After that notice 4 bytes which are of no use to us. Continue and note
that you find the width and height as 1 word each next to each other
in a convienient hex form. Write them down so we know them later. Next find
"BODY" and notice the size in bytes following it. I hope that number
isn't larger than about $190!! If it is, scale back a bit. Now the
nasty part: copy down all those strange looking numbers following the
size. This is another reason to keep the picture small!!! As mentioned
before, your picture can be displayed in any of 3 color registers.
You can define the color registers to be anything you want. Just
locate sector $146 and find the byte sequence that is as follows:
0FFF0000077C0BBB. They are the first 4 color registers. Place your picture
in the format discribed above at sector $148, byte $1B8 (or whereever you
see "00010408...")
For those of you who have been busily skipping over all of the above and
just want an example, here it is:
00 01 04 08 55 66 0123456787898...
more to come color #1 width height X & Y destination your picture
(FF-the end)
There is no limit to what kinds of things you can create except how
many bytes you can find!! I personally have a simple white on black
"INSERT DOS", but you could get really elaborate. For example, you
could write a custom routine to draw a circle with a line through it and
the letters S and T in the center. BE CREATIVE!!! HAVE FUN!!!
-- Dan Babcock, user OPS239. If you ever have any questions at any time,
just send me a message and I will try to answer.
^ ^
|___________________ end of original text _________________________|
To make things a little easier the assembled code for the above code examples
appears below. The four columns under the OBJECT label contain the
data to be entered using Diskzap at block # $147 (Hex) byte # $F8 (Hex).
below each code example is the position in the DiskZap screen that
the changes would appear. The only difference from the original patch
above is the zero long word (4 bytes) at $FE8D60. This long word will be
used for checksum correction later on.
xxxxxxxx = continuation address
= 00FE8D6A (for normal exit with artwork display)
= 00FE8DCA (to skip artwork display)
yyyyyyyy = number of bytes in extension RAM
zzzzzzzz = starting address of extension RAM
(all numbers are 4 bytes with leading zeros)
===================== NORMAL EXTENSION RAM PATCH ==========================
LOC OBJECT STMT SOURCE STATEMENT
------ ---------------- ---- --------------------------------
FE8CF8 1 ORG $FE8CF8
FE8CF8 4EF9 xxxx xxxx 2 JMP $xxxxxxxx
FE8CFE 48E7 E0C2 3 MOVEM.L D0/D1/D2/A0/A1/A6,-(A7)
FE8D02 2C78 0004 4 MOVE.L 4,A6
FE8D06 203C yyyy yyyy 5 MOVE.L #$yyyyyyyy,D0
FE8D0C 223C 0010 0005 6 MOVE.L #$100005,D1
FE8D12 7400 7 MOVEQ #0,D2
FE8D14 207C zzzz zzzz 8 MOVE.L #$zzzzzzzz,A0
FE8D1A 93C9 9 SUB.L A1,A1
FE8D1C 4EAE FD96 10 JSR -618(A6)
FE8D20 4CDF 4307 11 MOVEM.L (A7)+,D0/D1/D2/A0/A1/A6
FE8D24 4EF9 00FE 88D6 12 JMP $FE88D6
FE8D60 13 ORG $FE8D60
FE8D60 0000 0000 14 DCB.L 1,0
DiskZap display (starting at block # $147, byte # $0F8):
0E0 4EF9XXXX XXXX48E7
100 E0C22C78 000420C3 yyyyyyyy 223C0010 00057400 207Czzzz zzzz93C9 4EAEFD96
120 4CDF4307 4EF900FE 88D6
140
160 00000000
=================== AMAZING COMPUTING 512K UPGRADE =======================
LOC OBJECT STMT SOURCE STATEMENT
------ ---------------- ---- --------------------------------
FE8CF8 1 ORG $FE8CF8
FE8CF8 4EF9 xxxx xxxx 2 JMP $xxxxxxxx
FE8CFE 48E7 E0C2 3 MOVEM.L D0/D1/D2/A0/A1/A6,-(A7)
FE8D02 08B9 0007 00BF D100 4 BCLR #7,$BFD100
FE8D0A 08F9 0003 00BF D100 5 BSET #3,$BFD100
FE8D12 08B9 0003 00BF D100 6 BCLR #3,$BFD100
FE8D1A 08F9 0007 00BF D100 7 BSET #7,$BFD100
FE8D22 08F9 0003 00BF D100 8 BSET #3,$BFD100
FE8D2A 08B9 0003 00BF D100 9 BCLR #3,$BFD100
FE8D32 2C78 0004 10 MOVE.L 4,A6
FE8D36 203C yyyy yyyy 11 MOVE.L #$yyyyyyyy,D0
FE8D3C 223C 0010 0005 12 MOVE.L #$100005,D1
FE8D42 7400 13 MOVEQ #0,D2
FE8D44 207C zzzz zzzz 14 MOVE.L #$zzzzzzzz,A0
FE8D4A 93C9 15 SUB.L A1,A1
FE8D4C 4EAE FD96 16 JSR -618(A6)
FE8D50 4CDF 4307 17 MOVEM.L (A7)+,D0/D1/D2/A0/A1/A6
FE8D54 4EF9 00FE 88D6 18 JMP $FE88D6
FE8D60 19 ORG $FE8D60
FE8D60 0000 0000 20 DCB.L 1,0
DiskZap display (starting at block # $147, byte # $0F8):
0E0 4EF9XXXX XXXX48E7
100 E0C208B9 000700BF D10008F9 000300BD D10008B9 000300BF D10008F9 000700BF
120 D10008F9 000300BF D10008B9 000300BF D1002C78 0004203C 00100005 207Czzzz
140 zzzz93C9 4EAEFD96 4CDF4307 4EF900FE 88D6
160 00000000
========================= "INSERT WORKBENCH" IMAGE ========================
DiskZap display (starting at block # $148, byte # $1B8):
1A0 00028525 5D510A19 E7FF1FFF
1C0 F7FFFFF7 FFF1FAFF 0A99FFFF 9FFFE7FF FFE7FFF9 FAFF0D93 C7C399C1 C1C313C1
1E0 FFC9C383 C3FDFF0A 87E79993 9FE7F989 E7FF91FE 99FDFF09 93E79F87 C3E7E199
DiskZap display (starting at block # $149, byte # $000):
000 E7FFFE99 0081FDFF 0999E799 93F9E599 9FE5FFFE 99009FFE E700FF0D 19C3C319
020 83F3C40F F3FFC4C3 99C3FEE7 00FFEFFF EFFFEFFF 03E7F1F1 7DFEFF00 F1F7FF03
040 C3F9F939 FEFF00F9 F7FF0AC3 C9C911C3 99FFC9C3 83C3FAFF 07999191 019988FF
060 91FE99FA FF068199 99298194 FFFE9900 81FAFF06 3C999939 9F9CFFFE 99009FFE
080 E7FDFF0A 3CC4C439 C39CFFC4 C399C3FE E7FDFFEF FFEFFFEF FFEFFFEF FFEFFFEF
0A0 FFEFFFEF FFEFFFEF FFEFFFEF FF0081FD FF06F7FF 39FFFF1F 1FFEFF02 1FFFFF00
0C0 E7FDFF06 E7FF39FF FF9F9FFE FF029FFF FF11E783 C1C313C1 FF39C313 9993C383
0E0 C393FFFF 0BE7999F 9989E7FF 29998993 89FE9902 89FFFF11 E799C381 99E7FF01
100 99998799 81999F99 FFFF0CE7 99F99F9F E5FF1199 9F93999F FE99FFFF 11819983
120 C30FF3FF 39C30F19 C3C399C3 19FFFF00
=============================================================================
Use DiskZap to insert the appropriate ADDMEM patch and the image patch
to your kickstart disk. Remember, the image patch need not be used
if you used 00FE8DCA for the xxxxxxxx value in the code patch. This
will save the tedious image entry but will leave a blank screen where
"Insert Workbench" used to be.
If all has gone well, your Kickstart will work as is, with one exception.
The checksum of the Kickstart disk has been corrupted by the changes.
this is where the SumKick program comes in. Use SumKick to determine the
current checksum of the disk. The result is a 4 byte hexadecimal number.
Write it down EXACTLY as it appears. Subtract the original checksum,
$56F2E2A6 from the current one. Use DiskZap again to locate the dummy
zero longword at address $FE8D60 (block # $147, byte # $160). Replace the
four zero bytes with the result of the subtraction. Use SumKick again
to correct the checksum. This time the checksum should be $56F2E2A6.
The disk is ready to be used. Delete the ADDMEM commands from your
startup-sequences AFTER you get this to work. The Guru will visit you
if you try to ADDMEM after you ADDMEM'd. Good Luck! Happy Hacking!
Brian Allston
PLink: BKA